﻿@{
    ViewBag.Title = "Index";
    Layout = null;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>骐翔咨询DOH系统</title>
    <script src="@Url.Content("~/Resources/lx/jquery-1.7.2.min.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $(function() {
            $(".loginadmin").click(function() {
                var username = $.trim($("[name='username']").val());
                var password = $.trim($("[name='password']").val());
                var safecode = $.trim($("[name='safecode']").val());
                if (username == "") {
                    alert("请填写用户名");
                    $("[name='username']").focus();
                    return;
                }
                if (password == "") {
                    alert("请填写密码");
                    $("[name='password']").focus()
                    return;
                }
                if (safecode == "") {
                    alert("请填写验证码");
                    $("[name='safecode']").focus()
                    return;
                }
                var data = { username: username, password: password, safecode: safecode };
                var option={
                    url:"@Url.Action("Index")",
                    data:data,
                    type:"POST",
                    dataType:"json",
                    success:function(json){
                        if (!json.success) {
                            alert(json.errmsg);
                            $("#codeimg").click();
                            return;
                        }else{
                            location.href = "@Url.Action("Index","Home")";
                        }
                    }
                };
                $.ajax(option);
            });


            $(".inputTxt a").click(function(){
                $(this).prev().find("input").val("");
            });
           
                $("[name='reset']").click(function() {
                    $("[name='username']").val("");
                    $("[name='password']").val("");
                    $("[name='safecode']").val("");
                }); 
                $("#codeimg").click(function() {
                    var src = "@Url.RouteUrl("WebUtils_SafeCode")";
                    $(this).attr("src", src+"?rnd="+new Date().getTime());
                });

                $(".refreshsafecode").click(function(){
                    $("#codeimg").click();
                });

            document.onkeydown = function(e){
                var ev = document.all ? window.event : e;
                if(ev.keyCode==13) {
                       $(".loginadmin").click();
                 }
            }
  
        });
    </script>
<!--[if lte IE 6]>
<script>
function correctPNG()
   {
   for(var i=0; i<document.images.length; i++)
      {
   var img = document.images[i]
   var imgName = img.src.toUpperCase()
   if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
      {
   var imgID = (img.id) ? "id='" + img.id + "' " : ""
   var imgClass = (img.className) ? "class='" + img.className + "' " : ""
   var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
   var imgStyle = "display:inline-block;" + img.style.cssText
   if (img.align == "left") imgStyle = "float:left;" + imgStyle
   if (img.align == "right") imgStyle = "float:right;" + imgStyle
   if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle 
   var strNewHTML = "<span " + imgID + imgClass + imgTitle
   + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
      + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
   + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
   img.outerHTML = strNewHTML
   i = i-1
      }
      }
   }
window.attachEvent("onload", correctPNG);
</script>
<![endif]-->
<style type="text/css">
body,p,input{padding:0;margin:0;}
img{border:none;}
body{font-size:12px;line-height:22px; background:url(@Url.Content("~/Resources/project/v3/bg.gif"));}
.pbg{ position:relative; z-index:0;}
.main{position:absolute; top:30%; left:39%; z-index:10; height:0; line-height:0; width:364px; margin:0 auto;}
.logo{ position:absolute; top:32px; left:142px; z-index:1000;}
.tit{ position:absolute; top:0; left:0;}
.lobg{ position:absolute; top:60px;}
.login{ position:absolute;  top:88px; left:28px; width:305px; }
.login td{padding-bottom:9px;}
.inputTxt{ position:relative; width:172px; height:33px;}
.inputTxt span{ position:absolute; top:0; left:0; z-index:0;}
.inputTxt input{position:absolute; top:2px; left:6px; z-index:10;background:url(@Url.Content("~/Resources/project/v3/trans.gif")); border:none; widows:150px; height:28px; line-height:28px; color:#FFF;}
.yzm{width:103px;height:29px;position:relative; float:left; margin-right:12px;}
.yzm span{ position:absolute; top:0; left:0; z-index:0;} 
.yzm input{background:url(@Url.Content("~/Resources/project/v3/trans.gif")); position:absolute; top:2px; left:5px; width:93px; z-index:10; border:none; height:24px; line-height:24px; color:#FFF;}
.ft{ position:absolute; z-index:1000; bottom:20px; left:40%; }
.inputTxt a{ display:block;background:url(@Url.Content("~/Resources/project/v3/trans.gif")); position:absolute; top:6px; right:6px; width:16px; height:16px; z-index:10; }
.pcio{position:absolute; top:30%; left:39%; z-index:5; margin-left:-200px; }
.sig{ position:absolute; bottom:10%; right:2%; width:150px; height:68px; opacity:0.6}
.sig img{ width:100%;height:100%}
</style>
</head>

<body>

<div class="logo"><a href="#"><img src="@Url.Content("~/Resources/project/v3/logo.png")" /></a></div>
<div class="ft"><img src="@Url.Content("~/Resources/project/v3/ft.png")" /></div>
<div class="main">
    <span class="lobg"><img src="@Url.Content("~/Resources/project/v3/lobg.png")" /></span>
    <div class="login">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="39" height="33"><img src="@Url.Content("~/Resources/project/v3/ico1.png")" /></td>
            <td width="172">
                <div class="inputTxt">
                    <span><img src="@Url.Content("~/Resources/project/v3/inbg2.png")" /></span>
                    <p><input name="username" type="text" tabindex="1" /></p>
                    <a href="javascript://" tabindex="-1"></a>
                </div>
            </td>
            <td rowspan="2" align="right"><a href="javascript://" class="loginadmin" tabindex="4"><img src="@Url.Content("~/Resources/project/v3/login.png")" /></a></td>
          </tr>
          <tr>
            <td><img src="@Url.Content("~/Resources/project/v3/ico2.png")" /></td>
            <td>
                <div class="inputTxt">
                    <span><img src="@Url.Content("~/Resources/project/v3/inbg.png")" /></span>
                    <p><input name="password" type="password" tabindex="2" /></p>
                    <a href="javascript://" tabindex="-1"></a>
                </div>
            </td>
          </tr>
          <tr>
            <td colspan="2">
               <div class="yzm">
                    <span><img src="@Url.Content("~/Resources/project/v3/yzm.png")" /></span>
                    <p><input name="safecode" type="text" maxlength="4" tabindex="3" /></p>
               </div>
               <div><img id="codeimg" src="@Url.RouteUrl("WebUtils_SafeCode")" style=" vertical-align:middle" /></div>
            </td>
            <td><a href="javascript://" class="refreshsafecode" style=" color:#fff;">看不请，换一下</a>&nbsp;</td>
          </tr>
        </table>
    </div>
    <div class="tit"><img src="@Url.Content("~/Resources/project/v3/tit.png")" /></div>
</div>
<div class="pcio"><img src="@Url.Content("~/Resources/project/v3/pico.png")" /></div>
<div class="pbg"><img src="@Url.Content("~/Resources/project/v3/pbg.jpg")" width="100%" /></div>
<div class="sig"><img src="@Url.Content("~/Resources/project/v3/sig.png")" /></div>

</body>
</html>
